Core.Widgets.Tree.Node.prototype.Element;

Core.Widgets.Tree.Node.prototype.getText = function () {
    return $( this.Element ).children( "a" ).get(0).innerHTML;
}

Core.Widgets.Tree.Node.prototype.setText = function ( text ) {
    $( this.Element ).children( "a" ).get(0).innerHTML = text;
};

Core.Widgets.Tree.Node.prototype.getURL = function () {
    return $( this.Element ).children( "a" ).get(0).href;
}

Core.Widgets.Tree.Node.prototype.setURL = function ( url ) {
    $( this.Element ).children( "a" ).get(0).href = url;
};

Core.Widgets.Tree.Node.prototype.click = function ( func ) {
    this.customclick = func;
}

Core.Widgets.Tree.Node.prototype.hover = function ( func1, func2 ) {
    this.custommouseover = func1;
    this.custommouseout = func2;
}

Core.Widgets.Tree.Node.prototype.hasChildren = function () {
    return ( $( this.Element ).children( "ul" ).get(0) ) ? true : false;
}

Core.Widgets.Tree.Node.prototype.toggle = function () {

    $( this.Element ).children( "ul" ).animate( {opacity: 'toggle', height: 'toggle' }, "normal" );

    var toggleIcon = $( this.Element ).children( "span.ToggleIcon" ).get(0);
    toggleIcon.innerHTML = ( toggleIcon.innerHTML == "q" ) ? "u" : "q";


}
